<%@ page contentType="text/html; charset=utf-8" language="java" extends="org.zizi.service.JspPageServlet" %>
<%@page import="java.util.ArrayList"%>
<%@page import="org.zizi.modal.VatType"%>
<%@page import="java.util.List"%>
<%@page import="org.zizi.manager.impl.DaoManager"%>
<%@page import="org.zizi.dao.VatTypeDao"%>
<%@page import="org.zizi.manager.LoginManager"%>
<%@page import="org.zizi.manager.Managers"%>
<%@page import="org.zizi.modal.User"%>
<%@page import="java.util.Date"%>
<%@page import="org.zizi.util.DateUtil"%>

<%
	User u = null;
	if (session != null) u = Managers.get(LoginManager.class).getUser(session.getId());
	if (u == null) response.sendRedirect("/login.jsp");

	VatTypeDao dao = Managers.get(DaoManager.class).getDao(VatTypeDao.class);
	List<VatType> types = null;
	if (u != null) types = dao.listAllVatTypes(true);
	else types = new ArrayList<VatType>();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>专用设置和技术维护费抵减系统</title>
<jsp:include page="engine.jsp" ></jsp:include>
<script type="text/javascript" src="script/table.js"></script>
<script type="text/javascript" src="script/submit.js"></script>
<script type="text/javascript" src="script/suggest.js"></script>
<script type="text/javascript" src="script/vat_credit.js"></script>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.content .submit_form_table {margin-top:15px; border-collapse:collapse; width:980px; font-size:12px;}
.content .submit_form_table td {border:solid 1px #CCC; line-height:21px;}
.content .submit_form_table td.title {background-color:#DDD; font-weight:bold;}
.content .submit_form_table .text_input75 {width:75px;}
.content .submit_form_table .text_input120 {width:120px;}
.content .submit_form_table .text_input200 {width:200px;}
.content .submit_form_table .text_input340 {width:340px;}
.content .submit_form_table .inner_table td {border:0; padding:0 3px;}
</style>
<script type="text/javascript">

<%
String jsobj = "";
for (VatType t : types)
{
	jsobj += ",{id:" + t.getId() + ", name:'" + t.getName() + "'}";
}
if (!jsobj.isEmpty()) jsobj = jsobj.substring(1);
	
out.println("var types=[" + jsobj + "];");
%>

function initVatCredit()
{
	createSubmitTable(null);
}

sinkEvent("load", initVatCredit);
sinkEvent("load", resize);
sinkEvent("resize", resize);
</script>
</head>
<body onclick="hide(1)">
	<input type="hidden" id="credit_id" value="0" />
	<div id="container">
		<div class="top"></div>
		<div class="nav">
			<div class="navbuttons">
				<div class="navitem" style="background:url(images/main/submit_a.gif)" onclick="jump('/submit.jsp')"></div>
				<div class="navitem" style="background:url(images/main/history_n.gif)" onclick="jump('/history.jsp')"></div>
				<div class="navitem" style="background:url(images/main/types_n.gif)" onclick="jump('/types.jsp')"></div>
				<div class="navitem" style="background:url(images/main/empower_n.gif)" onclick="jump('/empower.jsp')"></div>
			</div>
			<div class="navcmds">
				<div style="background:url(images/main/logout.gif) no-repeat;"><a href="#" onclick="logout(); return false;">退出系统</a></div>
			</div>
		</div>
		<div class="content" id="table_content">
		</div>
		<div style="width:980px; line-height:20px; border:0; font-size:12px; text-align:left; margin:auto; padding-top:5px;">
			<b>填表说明：</b><br/>
			1. 日期格式请写成：20120101。<br/>
			2. 项目内容栏：抵减凭证为增值税专用发票的，项目内容栏填写增值税税控系统专用设备类别；抵减凭证为普通发票的，项目内容栏填写费用类别。 <br/>
			3. 日期栏：抵减凭证为增值税专用地票的，日期栏填写增值税税控系统初始发行日期；抵减凭证为普通发票的，日期栏填写缴纳技术维护费起止时间。 <br/>
			4. 本期未抵减税额 = 可抵减金额 - 本期申报抵减税额。 <br/>
			5. 本期应抵减税额栏：填写本清单中增值税专用发票和普通发票价税合计金额栏的合计金额。 <br/>
		</div>
		<div style="width:980px; padding-top:10px; padding-bottom:10px;"><input type="button" value="提交" style="width:100px; margin-left:5px" onclick="submit(this, false)" /></div>
	</div>
	<select id="suggests" size="10" style="width:300px; position:absolute; padding:0; display:none;" onchange="select()" onkeyup="hide(2)" >
	</select>
</body>
</html>